/* Sentinel - IRC Statistical and Operator Services
** token.h - Tokenization routines
**
** Copyright W. Campbell and others.  See README for more details
** Some code Copyright: Jonathan George, Kai Seidler, ircd-hybrid Team,
**                      IRCnet IRCD developers.
**
** $Id: token.h,v 1.1 2003/09/11 15:02:12 wcampbel Exp $
*/

#ifndef TOKEN_H
#define TOKEN_H

#define TOKEN_UNMATCHED -1
#define TOKEN_ERROR -2

struct Token
{
  const char *text;
  int value;
};

/* Returns the value of the token, TOKEN_UNMATCHED, or TOKEN_ERROR */
int token_to_value(struct Token *, char *);

/* WARNING... This will only return the first instance of the value in the
** token array
**
** Returns the token or NULL
*/
const char *value_to_token(struct Token *, int);

#endif
